package frontend.listeners;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.SwingUtilities;

import frontend.controller.MainFrameController;
import frontend.view.MainFrame;

public class MainMouseListener  implements  MouseListener {

	private MainFrame frame = MainFrame.getInstance();
	
	@Override
	public void mouseReleased(MouseEvent e) {
		if (SwingUtilities.isRightMouseButton(e)) {
			MainFrameController.getInstance().mouse(e);
			showPopup(e);
		}
	}

	private void showPopup(MouseEvent e) {

		frame.getPopup().show(e.getComponent(), e.getX(), e.getY());

	}
	
	@Override
	public void mouseClicked(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseEntered(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseExited(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mousePressed(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}

}
